go (Just s) = return $ Config "gitversion" $ StringConfig s
go Nothing = do
v <- Git.Version.installed
- let oldestallowed = Git.Version.normalize "2.1"
+ let oldestallowed = Git.Version.normalize "2.5"
when (v < oldestallowed) $
error $ "installed git version " ++ show v ++ " is too old! (Need " ++ show oldestallowed ++ " or newer)"
return $ Config "gitversion" $ StringConfig $ show v
for exporttree=yes/importtree=yes remotes.
* Bump aws build dependency to 0.24.1.
* stack.yaml: Update to lts-24.2.
+ * Removed support for git versions older than 2.5.
-- Joey Hess <id@joeyh.name> Wed, 30 Jul 2025 13:45:42 -0400
import Logs.Smudge
import Logs.Location
import qualified Database.Keys
-import qualified Git.BuildVersion
import Git.FilePath
import Git.Types
import Git.HashObject
Annex.BranchState.disableUpdate -- optimisation
b <- liftIO $ L.hGetContents stdin
let passthrough = liftIO $ L.hPut stdout b
- -- Before git 2.5, failing to consume all stdin here would
- -- cause a SIGPIPE and crash it.
- -- Newer git catches the signal and stops sending, which is
- -- much faster. (Also, git seems to forget to free memory
- -- when sending the file, so the less we let it send, the
- -- less memory it will waste.)
- let discardreststdin = if Git.BuildVersion.older "2.5"
- then L.length b `seq` return ()
- else liftIO $ hClose stdin
+ let discardreststdin = liftIO $ hClose stdin
let emitpointer = liftIO . S.hPut stdout . formatPointer
clean' file (parseLinkTargetOrPointerLazy' b)
passthrough
+++ /dev/null
-{- git build version
- -
- - Copyright 2011 Joey Hess <id@joeyh.name>
- -
- - Licensed under the GNU AGPL version 3 or higher.
- -}
-
-module Git.BuildVersion where
-
-import Git.Version
-import qualified BuildInfo
-
-{- Using the version it was configured for avoids running git to check its
- - version, at the cost that upgrading git won't be noticed.
- - This is only acceptable because it's rare that git's version influences
- - code's behavior. -}
-buildVersion :: GitVersion
-buildVersion = normalize BuildInfo.gitversion
-
-older :: String -> Bool
-older n = buildVersion < normalize n
import Git.HashObject
import qualified Git.LsTree as LsTree
import qualified Utility.CoProcess as CoProcess
-import qualified Git.BuildVersion as BuildVersion
import Utility.Tuple
data CatFileHandle = CatFileHandle
withCatFileStream check repo reader = assertLocal repo $
bracketIO start stop $ \(c, hin, hout, _) -> reader c hin hout
where
- params = catMaybes
- [ Just $ Param "cat-file"
- , Just $ Param ("--batch" ++ (if check then "-check" else "") ++ "=" ++ batchFormat)
- -- This option makes it faster, but is not present in
- -- older versions of git.
- , if BuildVersion.older "2.4.3"
- then Nothing
- else Just $ Param "--buffer"
+ params =
+ [ Param "cat-file"
+ , Param ("--batch" ++ (if check then "-check" else "") ++ "=" ++ batchFormat)
+ , Param "--buffer" -- makes it faster
]
start = do
Git
Git.AutoCorrect
Git.Branch
- Git.BuildVersion
Git.Bundle
Git.CatFile
Git.CheckAttr